package com.chinamsp.configuration;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import com.chinamsp.baisc.util.ApplicationConstants;

/**
 * swagger 配置
 * @author shifenghu
 * @version 1.0
 */
@ConfigurationProperties(prefix = SwaggerSettingsProperties.PREFIX)
@Configuration
public class SwaggerSettingsProperties {
	
	public static final String PREFIX = ApplicationConstants.PROPERTIES_PREFIX + ".swagger";
	
	
	/**
	 * 分组名称
	 */
	private String groupName = "ChinaMSP XXX 微服务项目";
	
	/**
	 * api 具体信息
	 */
	private ApiInfoProperties apiInfo;

	public String getGroupName() {
		return groupName;
	}


	public void setGroupName(String groupName) {
		this.groupName = groupName;
	}


	public ApiInfoProperties getApiInfo() {
		return apiInfo;
	}


	public void setApiInfo(ApiInfoProperties apiInfo) {
		this.apiInfo = apiInfo;
	}
	
	public static final class ApiInfoProperties {

		/**
		 * 标题
		 */
		private String title;

		/**
		 * 描述
		 */
		private String description;

		/**
		 * 版本
		 */
		private String version = "1.0";

		/**
		 * 技术团队支持网站
		 */
		private String termsOfServiceUrl = "无";

		/**
		 * 授权
		 */
		private String license = "商业版本";
		
		/**
		 * 授权说明url
		 */
		private String licenseUrl = "无";
		
		/**
		 * 联系人
		 */
		private ContactProperties contact = new ContactProperties("ChinaMSP", "http://www.chinamsp.com", "dev@chinamsp.com");

		
		public ApiInfoProperties(){}
		
		public ApiInfoProperties(String title, String description){
			this.title = title;
			this.description = description;
		}
		
		public String getTitle() {
			return title;
		}

		public void setTitle(String title) {
			this.title = title;
		}

		public String getDescription() {
			return description;
		}

		public void setDescription(String description) {
			this.description = description;
		}

		public String getVersion() {
			return version;
		}

		public void setVersion(String version) {
			this.version = version;
		}

		public String getTermsOfServiceUrl() {
			return termsOfServiceUrl;
		}

		public void setTermsOfServiceUrl(String termsOfServiceUrl) {
			this.termsOfServiceUrl = termsOfServiceUrl;
		}

		public ContactProperties getContact() {
			return contact;
		}

		public void setContact(ContactProperties contact) {
			this.contact = contact;
		}

		public String getLicense() {
			return license;
		}

		public void setLicense(String license) {
			this.license = license;
		}

		public String getLicenseUrl() {
			return licenseUrl;
		}

		public void setLicenseUrl(String licenseUrl) {
			this.licenseUrl = licenseUrl;
		}
		
		

	}

	public static final class ContactProperties {
		private String name;
		private String url;
		private String email;

		
		public ContactProperties() {}
		
		
		public ContactProperties(String name, String url, String email) {
			this.name = name;
			this.url = url;
			this.email = email;
		}
		
		public String getName() {
			return name;
		}

		public void setName(String name) {
			this.name = name;
		}

		public String getUrl() {
			return url;
		}

		public void setUrl(String url) {
			this.url = url;
		}

		public String getEmail() {
			return email;
		}

		public void setEmail(String email) {
			this.email = email;
		}

	}
}
